/*
 * ScopeInstanceDescription.java
 * 
 * last update: 16.01.2010 by Stefan Saru
 * 
 * author:	Alec(panovici@elcom.pub.ro)
 * 
 * Obs:
 */

package engine;

import middle.*;

/**
 * Describes the instantiation of a NameSpace (other than Module: @see ModuleInstanceescription)
 */
class ScopeInstanceDescription extends Symbol{

	NameSpaceDescription nsd;

	ScopeInstanceDescription(NameSpaceDescription theScope, int lineNo){
		super(theScope.name(), lineNo);
		nsd = theScope;
	}

	Object instantiate(NameSpace parent, ScopeNode thisScope)throws ParseException{
		NameSpace ns = new NameSpace(parent, nsd);
		nsd.instantiateAll(ns, thisScope.addScope(Constants.blockIcon, name));
		return ns;
	}

	public int getType(){
		return Symbol.blockType;
	}
}
